package com;

import com.itheima.domain.Account;
import com.itheima.service.AccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class Test {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("ApplicationContext.xml");
        AccountService accountService = (AccountService) context.getBean("accountService");
        Account account = new Account();
        account.setId(3);
        account.setName("Mary");
        account.setMoney(1555.11);

        accountService.save(account);
        List all = accountService.findAll();
        System.out.println(all);

        Account res = accountService.findById(3);
        System.out.println(res);
    }
}
